Class MyEventDateComparator


  • public class MyEventDateComparator
    extends MyEventComparator
    This class represents the concept of comparison of two events. It has a single abstract method that is to be implemented by concrete subclasses which implement concrete modes of comparison, e.g. by attendees, by date or other.
    Since:
    ExerciseSheet04
    Version:
    1
    Author:
    Jonas Altrock (ew20b126@technikum-wien.at)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Event e1, Event e2)
      Compare two events by their dates.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MyEventDateComparator

        public MyEventDateComparator()
    • Method Detail

      • compare

        public int compare​(Event e1,
                           Event e2)
        Compare two events by their dates.
        Specified by:
        compare in class MyEventComparator
        Parameters:
        e1 - the one event to compare
        e2 - the other event to compare
        Returns:
        a measure of the distance between e1 and e2 in the sense of the comparator